package com.xjj.service.job;

import com.xjj.entity.ResponseEntity;
import com.xjj.service.feign.JobFeignClient;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author sjy
 * @create 2022-10-25 17:19
 */
@Component
public class UpdateJobStatus implements Job {
    @Autowired
    private JobFeignClient jobFeignClient;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        Integer id = context.getMergedJobDataMap().getInt("id");
        System.out.println(id);
        ResponseEntity<String> responseEntity = jobFeignClient.updateJobStatus(id);
        System.out.println("执行了"+responseEntity.getData());
    }
}
